package com.heyqing.medium.day10;

/**
 * ClassName:ConstructRectangle
 * Package:com.heyqing.medium.day10
 * Description:
 *
 * @Date:2024/10/12
 * @Author:Heyqing
 */
public class ConstructRectangle {
    public int[] constructRectangle(int area) {
        int l = (int) Math.sqrt(area), w = l;
        while (w * l != area) {
            if (w * l > area) l--;
            else w++;
        }
        int[] res = {w, l};
        return res;
    }
}
